package com.zhuiyun.project.api.learnPlan.mapper;

import com.zhuiyun.project.api.learnPlan.entity.LearnPlan;
import com.zhuiyun.project.common.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName MusicMapper
 * @Description TODO
 * @Author ZZ
 * @Date 2023/12/26 16:53
 **/
@Mapper
public interface LearnPlanMapper extends BaseMapper<LearnPlan> {

    @Select("select * from learnplan where user_id=#{planId} plan_date=#{planDate}")
    List<LearnPlan> selectAll(LearnPlan learnPlan);

    /**
     * @Author zf
     * @Date 2024/2/22/18:50 TODO 添加学习计划内容小程序
     * @param learnPlan
     * @return List<PoetryAuthor>
     */
    @Insert("INSERT INTO learnplan (user_id,plan_date,plan_time,plan_request,`status`) VALUES(#{userId},#{planDate},#{planTime},#{planRequest},#{status})")
    @Options(useGeneratedKeys = true, keyProperty = "planId")
    int insertLearnPlanQ(LearnPlan learnPlan);
}
